public class LinearSearch {

    private LinearSearch() {}

    public static <E> int search(E[] data, E key) {
        if (data == null || data.length <= 1) {
            return -1;
        }

        for (int i = 0; i < data.length; i++) {
            if (data[i].equals(key)) {
                return i;
            }
        }

        return -1;
    }
}
